import sys
import os
from PySide6.QtWidgets import *
from PySide6.QtGui import *
from PySide6.QtCore import *

class Demo(QWidget):
    def __init__(self, parent=None):
        super().__init__(parent)
        self.parent = parent
        layout = QVBoxLayout()
        layout.setAlignment(Qt.AlignmentFlag.AlignTop)       

        self.keyEdit=QKeySequenceEdit()
        self.keyEdit.editingFinished.connect(self.OnKeyEditFinished)
        layout.addWidget(self.keyEdit)        

        self.setLayout(layout)
    def OnKeyEditFinished(self):
        shortcut=self.keyEdit.keySequence().toString()
        self.parent.OnShowMessage(f'Set ShortCut: {shortcut}')
def runDemo(parent):
    wigdet =  Demo(parent)
    return wigdet